package com.example.Dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.TextView;

import com.example.callservice.R;
import com.example.object.ElectricPanels;
import com.example.ultil.Ultil;

public class DialogPanelDetail extends Dialog {

	public DialogPanelDetail(Context context, int i) {
		super(context);
		// TODO Auto-generated constructor stub
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_detail_map);
		
		ImageButton btnClose = (ImageButton) findViewById(R.id.btnClose);
		btnClose.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				DialogPanelDetail.this.dismiss();
			}

		});
		TextView txtEnterprise_Name = (TextView) findViewById(R.id.txtEnterprise_Name);
		TextView txtEVNCode = (TextView) findViewById(R.id.txtEVNCode);
		TextView txtRoad_Name = (TextView) findViewById(R.id.txtRoad_Name);
		TextView txtAddress = (TextView) findViewById(R.id.txtAddress);
		TextView txtStatus_Name = (TextView) findViewById(R.id.txtStatus_Name);
		TextView txtPanel_Type_Name = (TextView) findViewById(R.id.txtPanel_Type_Name);
		TextView txtInstalled_Type_Name = (TextView) findViewById(R.id.txtInstalled_Type_Name);
		TextView txtActual_Capacity = (TextView) findViewById(R.id.txtActual_Capacity);

		TextView txtDesign_Capacity = (TextView) findViewById(R.id.txtDesign_Capacity);
		TextView txtLongevity = (TextView) findViewById(R.id.txtLongevity);
		// TextView txtEnterprise_Name = (TextView)
		// findViewById(R.id.txtEnterprise_Name);
		txtEnterprise_Name.setText(Ultil.lstElectricPanel.get(i)
				.getEnterprise_Name());
		txtEVNCode.setText(Ultil.lstElectricPanel.get(i).getEVNCode());
		txtRoad_Name.setText(Ultil.lstElectricPanel.get(i).getRoad_Name());
		txtAddress.setText(Ultil.lstElectricPanel.get(i).getAddress());
		txtStatus_Name.setText(Ultil.lstElectricPanel.get(i).getStatus_Name());
		txtPanel_Type_Name.setText(Ultil.lstElectricPanel.get(i)
				.getPanel_Type_Name());
		txtInstalled_Type_Name.setText(Ultil.lstElectricPanel.get(i)
				.getInstalled_Type_Name());
		txtActual_Capacity.setText(Ultil.lstElectricPanel.get(i)
				.getActual_Capacity());
		txtDesign_Capacity.setText(Ultil.lstElectricPanel.get(i)
				.getDesign_Capacity());
		txtLongevity.setText(Ultil.lstElectricPanel.get(i).getLongevity());
	}

	public DialogPanelDetail(Context context, ElectricPanels electricPanel) {
		super(context);
		// TODO Auto-generated constructor stub
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_detail_map);
		
		ImageButton btnClose = (ImageButton) findViewById(R.id.btnClose);
		btnClose.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				DialogPanelDetail.this.dismiss();
			}

		});
		TextView txtEnterprise_Name = (TextView) findViewById(R.id.txtEnterprise_Name);
		TextView txtEVNCode = (TextView) findViewById(R.id.txtEVNCode);
		TextView txtRoad_Name = (TextView) findViewById(R.id.txtRoad_Name);
		TextView txtAddress = (TextView) findViewById(R.id.txtAddress);
		TextView txtStatus_Name = (TextView) findViewById(R.id.txtStatus_Name);
		TextView txtPanel_Type_Name = (TextView) findViewById(R.id.txtPanel_Type_Name);
		TextView txtInstalled_Type_Name = (TextView) findViewById(R.id.txtInstalled_Type_Name);
		TextView txtActual_Capacity = (TextView) findViewById(R.id.txtActual_Capacity);

		TextView txtDesign_Capacity = (TextView) findViewById(R.id.txtDesign_Capacity);
		TextView txtLongevity = (TextView) findViewById(R.id.txtLongevity);
		// TextView txtEnterprise_Name = (TextView)
		// findViewById(R.id.txtEnterprise_Name);
		txtEnterprise_Name.setText(electricPanel.getEnterprise_Name());
		txtEVNCode.setText(electricPanel.getEVNCode());
		txtRoad_Name.setText(electricPanel.getRoad_Name());
		txtAddress.setText(electricPanel.getAddress());
		txtStatus_Name.setText(electricPanel.getStatus_Name());
		txtPanel_Type_Name.setText(electricPanel.getPanel_Type_Name());
		txtInstalled_Type_Name.setText(electricPanel.getInstalled_Type_Name());
		txtActual_Capacity.setText(electricPanel.getActual_Capacity());
		txtDesign_Capacity.setText(electricPanel.getDesign_Capacity());
		txtLongevity.setText(electricPanel.getLongevity());
	}
}
